home *** CD-ROM | disk | FTP | other *** search
/ PC Graphics Unleashed / PC Graphics Unleashed.iso / ch17 / pi / roomfly / roomfly1.pi < prev    next >
Encoding:
Text File  |  1994-08-05  |  2.7 KB  |  141 lines

  1. // Scene File: ROOMFLY1.PI
  2. // Author: Rob McGregor
  3. //
  4. // View of Venus de Milo as 3 spheres and 2 spotlights fly around her
  5.  
  6. // Define the range of the animation
  7. start_frame 0
  8. end_frame   60
  9. outfile     "room1"
  10.  
  11. directional_light <1, 5, -1>
  12. light <150, 5, -150>
  13.  
  14. // Set up the camera
  15. viewpoint {
  16.   from            <9, 0.5, -12>
  17.   at              <0, 0, 0> 
  18.   up              <0, 1, 0>
  19.   angle           45
  20.   resolution      320,200
  21.   aspect          1.6
  22.   max_trace_depth 2
  23. }
  24.  
  25. if (frame == start_frame) {
  26.   include "..\..\..\colors.inc"
  27.   include "..\..\..\texture.inc"
  28.   include "..\..\..\stones.inc"
  29.   include "pedestal.inc"
  30.   include "picframe.inc"
  31.   include "room.inc"
  32.   include "sphrpath.inc"  
  33.   include "spotpath.inc"  
  34.   include "..\venus\venus.inc"
  35. }
  36.  
  37. // Set up the key frames in an array
  38. define KF [0, 8, 17, 26, 35, 44, 53, 62]
  39.  
  40. // Assign the value of "frame" to variable "F"
  41. define F frame
  42.  
  43. // Determine what key frame sequence we're in
  44. if (F <= KF[1])               
  45.   define key 0
  46. if (F > KF[1] && F <= KF[2])
  47.   define key 1
  48. if (F > KF[2] && F <= KF[3])
  49.   define key 2
  50. if (F > KF[3] && F <= KF[4])
  51.   define key 3
  52. if (F > KF[4] && F <= KF[5])
  53.   define key 4
  54. if (F > KF[5] && F <= KF[6])
  55.   define key 5
  56. if (F > KF[6])
  57.   define key 6
  58.  
  59. // Calculate the value of "t" from the 
  60. // current frame and key frame sequence
  61. define F1 KF[key]
  62. define F2 KF[key + 1]
  63. define t  (F - F1) / (F2 - F1)
  64.  
  65. // Calculate the values of all object's location vectors
  66. define t3 t^3
  67. define t2 t^2
  68.  
  69. include "sphrcalc.inc"
  70.  
  71. // Now move the spheres to their new locations
  72. // Sphere1
  73. object {
  74.   sphere <0, 0, 0>, 0.5
  75.   reflective_red
  76.   translate <s1Px, s1Py, s1Pz>
  77. }
  78.  
  79. // Sphere2
  80. object {
  81.   sphere <0, 0, 0>, 0.5
  82.   reflective_blue
  83.   translate <s2Px, s2Py, s2Pz>
  84. }
  85.  
  86. // Sphere3
  87. object {
  88.   sphere <0, 0, 0>, 0.5
  89.   reflective_green
  90.   translate <s3Px, s3Py, s3Pz>
  91. }
  92.  
  93. include "spotcalc.inc"
  94.  
  95. define statue
  96. object {
  97.   object { 
  98.     venus 
  99.     rotate <-90, 0, 0>
  100.     translate <0, 0, 0>
  101.     rotate <0, 180, 0>
  102.     real_marble {scale <0.2, 0.2, 0.2>}
  103.     scale <0.5, 0.5, 0.5>
  104.   }
  105. +
  106.   object { 
  107.     pedestal
  108.     scale <3,4,3>  
  109.     rotate <0, 10, 0>
  110.     translate <0.1, -3.6, 0.25>
  111.     real_marble {scale <0.25, 0.25, 0.25>}
  112.   }
  113.   rotate <0, -45, 0>
  114.   translate <0, 0.5, 0>
  115. }
  116.  
  117. // The room, statue and paintings
  118. object {
  119.   object {
  120.     room2  
  121.   }
  122. +
  123.   object { statue }
  124. +
  125.   // picture1
  126.   object {
  127.     picture1
  128.     scale <0.125, 0.125, 0.125>
  129.     rotate <0, 90, 0>
  130.     translate <-9.95, 3.5, 0>
  131.   }
  132. +
  133.   // picture2
  134.   object {
  135.     picture2
  136.     scale <0.125, 0.125, 0.125>
  137.     //rotate <0, 90, 0>
  138.     translate <0, 3.5, 9.95>
  139.   }
  140. }
  141.